package com.samphanie.mbg.config;

import com.samphanie.common.config.BaseRedisConfig;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Configuration;

/**
 * 使用redis时的配置，默认生效
 *
 * @author ZSY
 * @email 1451691457@qq.com
 */
@Configuration
@ConditionalOnProperty(prefix = "fantastic.cache", name = "fantasticCache", havingValue = "redis", matchIfMissing = true)
public class MyRedisConfig extends BaseRedisConfig {

//    /**
//     * redisson 配置
//     */
//    @Bean(destroyMethod="shutdown")
//    public RedissonClient redisson() throws IOException {
//        // 1.创建配置
//        Config config = new Config();
//        //        config.useClusterServers()
//        //                .addNodeAddress("127.0.0.1:7004", "127.0.0.1:7001");
//        config.useSingleServer().setAddress("redis://47.103.97.79:6379").setPassword("Zxx131013@");
//        // 2.根据Config 创建出RedissonClient
//        return Redisson.create(config);
//    }


}
